﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;

public class BossBlood : MonoBehaviour
{
    public int blood = 500;
    public UnityEvent onDeath;

    private void Update()
    {
        //Hurt(1);
    }
    public void Hurt(int value)
    {
        if (blood > 0)
        {
            blood -= value;
            if (blood <= 0)
            {
                blood = 0;
                onDeath?.Invoke();
            }
        }
    }
}
